Repository navigation
Add Laplacian filter kernel doctests - #114
Open
pruthvirajgojare-source wants to merge 2 commits into
Open
pruthvirajgojare-source wants to merge 2 commits into
pruthvirajgojare-source wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds doctests to
my_laplaciandemonstrating every supported kernel size with a small in-memory NumPy image. This exercises the valid filtering path and documents the existing invalid-kernelValueErrorwithout relying on image files.Related Issue
No related issue identified.
Fixes: N/A (no related issue)
Type of Change
Changes Made
ksize1, 3, 5, and 7.ksize=0example, which raisesValueError: ksize must be in (1, 3, 5, 7).work/R23-T050/BASELINE.md.my_laplacian(6/6 statements).Screenshots / Recordings
Not applicable; no UI changes.
Testing
>=3.15.uv run --no-project --python 3.12 --with numpy --with opencv-python-headless --with pytest --with pytest-cov pytest digital_image_processing/filters/laplacian_filter.py --cov=digital_image_processing/filters --cov-report=term-missing— passed, 1 pytest item;my_laplaciancoverage is 100%.uv run --no-project --python 3.12 --with numpy --with opencv-python-headless --with pytest python -m doctest -v digital_image_processing/filters/laplacian_filter.py— passed. Summary:6 tests in 2 items; 6 passed and 0 failed.uvx ruff check digital_image_processing/filters/laplacian_filter.py— passed.uvx ruff format --check digital_image_processing/filters/laplacian_filter.py— passed.Checklist
Additional Notes
The coverage report for the entire file is 59% because the interactive
__main__image-display example (lines 81–95) is not executed during doctests. Every executable statement withinmy_laplacian, including all four valid kernels and the invalid-kernel branch, is covered. A separate localupstream/R23-T050branch contains only the code change; no upstream PR was opened.